/**
 * 
 */
package hibernate;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import model.IAlbum;
import model.ISong;

import org.hibernate.annotations.Proxy;

/**
 * @author ipeel
 *
 */
@Entity
@Table (name="song")
@Proxy(proxyClass=ISong.class)
public class Song implements ISong{
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@Column(name="song_id")
	private Integer id;

	@ManyToOne(targetEntity=Album.class, fetch=FetchType.LAZY)
	@JoinColumn(name="album_id", insertable=false, updatable=false)
	private IAlbum album;
	
	@Column(name="name")
	private String name;
	
	@Column(name="path")
	private String path;
	
	@Column(name="track_number")
	private String trackNumber;
	
	public IAlbum getAlbum() {
		return album;
	}
	public void setAlbum(IAlbum album) {
		this.album = album;
	}
	
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	
	public String getPath() {
		return path;
	}
	public void setPath(String path) {
		this.path = path;
	}
	
	public String getTrackNumber() {
		return trackNumber;
	}
	public void setTrackNumber(String trackNumber) {
		this.trackNumber = trackNumber;
	}	
}
